﻿<?php
include_once "db.php";
/**
 * Created by IntelliJ IDEA.
 * User: fanxu(746439274@qq.com)
 * Date: 16/8/3
 * Time: 下午4:38
 */
function getSession( $openid ){
    $url = 'http://localhost:8080/MallInterface/Login.aspx';
    $url .= '?Type=1&userno=' . $openid . '&vipid=';
    $result = file_get_contents( $url );
    $result = json_decode( $result , true );
    ini_set('display_errors','on');
    Mysql::getInstance()->insert(
        'lw_event_log',
        'createdate,openid,url',
        time() .',"'.$openid. '","'.$url.'"'
    );
    if( !empty( $result ) && is_array( $result ) && $result['status'] == 0 ){
        return $result;
    }
    return array();
}
